/**
 * Generate time : 2011-05-27 15:38:18
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cm.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCMMaterialType
 * 
 */
public class ZMCMMaterialType extends DaoEPBase {

	private String fdKeyId = " "; /* 主键 */
	private String fdTypeCode = " "; /* 类别编码 */
	private String fdTypeInnerCode = " "; /* 类别内码 */
	private String fdTypeName = " "; /* 类别名称 */
	private String fdMaterialClassify = " "; /* 材料分类 */
	private Long fdTypeLevel = new Long(0); /* 类别层级 */
	private String fdParentId = " "; /* 父类编码ID */
	private Long fdIsAddmaterial = new Long(0); /* 是否允许加入物资 */
	private String fdParentTypeCode = " "; /* 父类编码 */
	private String fdParentTypeName = " "; /* 父类名称 */
	private String fdParentTypeInnerCode = " "; /* 父类内码 */
	private String fdTypeAllCode = " "; /* 类别全码 */
	private String materoalId = " ";
	private String materoalName = " ";
	private Double fdSum = new Double(0); /* 金额上限 */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("主键");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdTypeCode");
		eiColumn.setFieldLength(7);
		eiColumn.setDescName("类别编码");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdTypeInnerCode");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("类别内码");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdTypeName");
		eiColumn.setFieldLength(80);
		eiColumn.setDescName("类别名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdMaterialClassify");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("材料分类");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdTypeLevel");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("类别层级");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentId");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("父类编码ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdIsAddmaterial");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("是否允许加入物资");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentTypeCode");
		eiColumn.setFieldLength(4);
		eiColumn.setDescName("父类编码");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentTypeName");
		eiColumn.setFieldLength(80);
		eiColumn.setDescName("父类名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdParentTypeInnerCode");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("父类内码");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdTypeAllCode");
		eiColumn.setFieldLength(4);
		eiColumn.setDescName("类别全码");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("materoalId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("物资主键");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("materoalName");
		eiColumn.setFieldLength(40);
		eiColumn.setDescName("物资名称");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdSum");
		eiColumn.setType("N");
		eiColumn.setScaleLength(5);
		eiColumn.setFieldLength(15);
		eiColumn.setDescName("金额上限");
		eiMetadata.addMeta(eiColumn);
	}

	/**
	 * the constructor
	 */
	public ZMCMMaterialType() {
		initMetaData();
	}

	/**
	 * get the fdKeyId - 主键
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - 主键
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdTypeCode - 类别编码
	 * 
	 * @return the fdTypeCode
	 */
	public String getFdTypeCode() {
		return this.fdTypeCode;
	}

	/**
	 * set the fdTypeCode - 类别编码
	 */
	public void setFdTypeCode(String fdTypeCode) {
		this.fdTypeCode = fdTypeCode;
	}

	/**
	 * get the fdTypeInnerCode - 类别内码
	 * 
	 * @return the fdTypeInnerCode
	 */
	public String getFdTypeInnerCode() {
		return this.fdTypeInnerCode;
	}

	/**
	 * set the fdTypeInnerCode - 类别内码
	 */
	public void setFdTypeInnerCode(String fdTypeInnerCode) {
		this.fdTypeInnerCode = fdTypeInnerCode;
	}

	/**
	 * get the fdTypeName - 类别名称
	 * 
	 * @return the fdTypeName
	 */
	public String getFdTypeName() {
		return this.fdTypeName;
	}

	/**
	 * set the fdTypeName - 类别名称
	 */
	public void setFdTypeName(String fdTypeName) {
		this.fdTypeName = fdTypeName;
	}

	/**
	 * get the fdMaterialClassify - 材料分类
	 * 
	 * @return the fdMaterialClassify
	 */
	public String getFdMaterialClassify() {
		return this.fdMaterialClassify;
	}

	/**
	 * set the fdMaterialClassify - 材料分类
	 */
	public void setFdMaterialClassify(String fdMaterialClassify) {
		this.fdMaterialClassify = fdMaterialClassify;
	}

	/**
	 * get the fdTypeLevel - 类别层级
	 * 
	 * @return the fdTypeLevel
	 */
	public Long getFdTypeLevel() {
		return this.fdTypeLevel;
	}

	/**
	 * set the fdTypeLevel - 类别层级
	 */
	public void setFdTypeLevel(Long fdTypeLevel) {
		this.fdTypeLevel = fdTypeLevel;
	}

	/**
	 * get the fdParentId - 父类编码ID
	 * 
	 * @return the fdParentId
	 */
	public String getFdParentId() {
		return this.fdParentId;
	}

	/**
	 * set the fdParentId - 父类编码ID
	 */
	public void setFdParentId(String fdParentId) {
		this.fdParentId = fdParentId;
	}

	/**
	 * get the fdIsAddmaterial - 是否允许加入物资
	 * 
	 * @return the fdIsAddmaterial
	 */
	public Long getFdIsAddmaterial() {
		return this.fdIsAddmaterial;
	}

	/**
	 * set the fdIsAddmaterial - 是否允许加入物资
	 */
	public void setFdIsAddmaterial(Long fdIsAddmaterial) {
		this.fdIsAddmaterial = fdIsAddmaterial;
	}

	/**
	 * get the fdParenttypeName - 父类Code
	 * 
	 * @return the fdParenttypeName
	 */
	public String getFdParentTypeCode() {
		return this.fdParentTypeCode;
	}

	/**
	 * set the fdParentTypeCode - 父类Code
	 */
	public void setFdParentTypeCode(String fdParentTypeCode) {
		this.fdParentTypeCode = fdParentTypeCode;
	}

	/**
	 * get the fdParentTypeName - 父类名称
	 * 
	 * @return the fdParentTypeName
	 */
	public String getFdParentTypeName() {
		return this.fdParentTypeName;
	}

	/**
	 * set the fdParentTypeName - 父类名称
	 */
	public void setFdParentTypeName(String fdParentTypeName) {
		this.fdParentTypeName = fdParentTypeName;
	}

	/**
	 * get the fdParentTypeInnerCode - 父类内码
	 * 
	 * @return the fdParentTypeInnerCode
	 */
	public String getFdParentTypeInnerCode() {
		return this.fdParentTypeInnerCode;
	}

	/**
	 * set the fdParentTypeInnerCode - 父类内码
	 */
	public void setFdParentTypeInnerCode(String fdParentTypeInnerCode) {
		this.fdParentTypeInnerCode = fdParentTypeInnerCode;
	}

	/**
	 * get the fdTypeAllCode - 类别全码
	 * 
	 * @return the fdTypeCode
	 */
	public String getFdTypeAllCode() {
		return this.fdTypeAllCode;
	}

	/**
	 * set the fdTypeAllCode - 类别全码
	 */
	public void setFdTypeAllCode(String fdTypeAllCode) {
		this.fdTypeAllCode = fdTypeAllCode;
	}

	/**
	 * get the materoalId - 物资主键
	 * 
	 * @return the materoalId
	 */
	public String getMateroalId() {
		return this.materoalId;
	}

	/**
	 * set the materoalId - 物资主键
	 */
	public void setMateroalId(String materoalId) {
		this.materoalId = materoalId;
	}

	/**
	 * get the materoalName - 物资名称
	 * 
	 * @return the materoalName
	 */
	public String getMateroalName() {
		return this.materoalName;
	}

	/**
	 * set the materoalName - 物资名称
	 */
	public void setMateroalName(String materoalName) {
		this.materoalName = materoalName;
	}
	
	/**
	 * get the fdSum - 金额上限
	 * 
	 * @return the fdSum
	 */
	public Double getFdSum() {
		return this.fdSum;
	}

	/**
	 * set the fdSum - 金额上限
	 */
	public void setFdSum(Double fdSum) {
		this.fdSum = fdSum;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdTypeCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdTypeCode")), fdTypeCode));
		setFdTypeInnerCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdTypeInnerCode")), fdTypeInnerCode));
		setFdTypeName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdTypeName")), fdTypeName));
		setFdMaterialClassify(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdMaterialClassify")), fdMaterialClassify));
		setFdTypeLevel(NumberUtils.toLong(StringUtils.toString(map.get("fdTypeLevel")), fdTypeLevel));
		setFdParentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentId")), fdParentId));
		setFdIsAddmaterial(NumberUtils.toLong(StringUtils.toString(map.get("fdIsAddmaterial")), fdIsAddmaterial));
		setFdParentTypeCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentTypeCode")), fdParentTypeCode));
		setFdParentTypeName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentTypeName")), fdParentTypeName));
		setFdParentTypeInnerCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdParentTypeInnerCode")), fdParentTypeInnerCode));
		setFdTypeAllCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdTypeAllCode")), fdTypeAllCode));
		setMateroalId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("materoalId")), materoalId));
		setMateroalName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("materoalName")), materoalName));
		setFdSum(NumberUtils.toDouble(StringUtils.toString(map.get("fdSum")), fdSum));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdTypeCode", StringUtils.toString(fdTypeCode, eiMetadata.getMeta("fdTypeCode")));
		map.put("fdTypeInnerCode", StringUtils.toString(fdTypeInnerCode, eiMetadata.getMeta("fdTypeInnerCode")));
		map.put("fdTypeName", StringUtils.toString(fdTypeName, eiMetadata.getMeta("fdTypeName")));
		map.put("fdMaterialClassify", StringUtils.toString(fdMaterialClassify, eiMetadata.getMeta("fdMaterialClassify")));
		map.put("fdTypeLevel", StringUtils.toString(fdTypeLevel, eiMetadata.getMeta("fdTypeLevel")));
		map.put("fdParentId", StringUtils.toString(fdParentId, eiMetadata.getMeta("fdParentId")));
		map.put("fdIsAddmaterial", StringUtils.toString(fdIsAddmaterial, eiMetadata.getMeta("fdIsAddmaterial")));
		map.put("fdParentTypeCode", StringUtils.toString(fdParentTypeCode, eiMetadata.getMeta("fdParentTypeCode")));
		map.put("fdParentTypeName", StringUtils.toString(fdParentTypeName, eiMetadata.getMeta("fdParentTypeName")));
		map.put("fdParentTypeInnerCode", StringUtils.toString(fdParentTypeInnerCode, eiMetadata.getMeta("fdParentTypeInnerCode")));
		map.put("fdTypeAllCode", StringUtils.toString(fdTypeAllCode, eiMetadata.getMeta("fdTypeAllCode")));
		map.put("materoalId", StringUtils.toString(materoalId, eiMetadata.getMeta("materoalId")));
		map.put("materoalName", StringUtils.toString(materoalName, eiMetadata.getMeta("materoalName")));
		map.put("fdSum", StringUtils.toString(fdSum, eiMetadata.getMeta("fdSum")));

		return map;

	}
}